<template>
  <div class="my_div">
    <img :src="url" alt=""/>
    <p @click="love(index)">{{name}}</p>
  </div>
</template>

<script>
export default {
  props:['url','name','index'],
  data(){
    return {

    }
  },
  methods:{
    love(index){
  // console.log(index)
  this.$emit('like',this.index)
    }
  }
}
</script>

<style> 
.my_div {
  width: 200px;
  border: 1px solid black;
  text-align: center;
  float: left;
}

.my_div img {
  width: 100%;
  height: 200px;
  
}
</style>
